<template>
	<view>
		<view class="my-search-container" :style="{'background-color': bgcolor}" @click="searchBoxHandler">
		  <view class="my-search-box" :style="{'border-radius': radius + 'px'}">
        <uni-icons type="search" size="17" v-if="icon"></uni-icons>
		    <text class="placeholder">{{innerText}}</text>
		  </view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
    methods: {
      searchBoxHandler() {
        // console.log('-------')
        this.$emit('click')
      }
    },
    props: {
      bgcolor: {
        type: String,
        default: '#c00000'
      },
      radius: {
        type: Number,
        default: 18
      },
      innerText: {
        type: String,
        default: '检索'
      },
      icon: {
        type: Boolean,
        default: true
      }
    },
	}
</script>

<style lang="scss">
  .my-search-container {
    height: 50px;
    // background-color: #c00000;
    padding: 0 10px;
    display: flex;
    align-items: center;
    .my-search-box{
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 36px;
      color: #333333;
      // border-radius: 18px;
      background-color: #FFFFFF;
      .placeholder {
        font-size: 15px;
        margin-left: 5px;
      }
    }
  }
</style>
